// JavaScript Document

function showHideIdAuto_headertop() {
    if (document.getElementById('list_name_top').style.display ==''){
        document.getElementById('list_name_top').style.display = 'none';
		document.getElementById('hide_select').style.display = 'block';
		document.getElementById('collap_js').className = 'pic_js';
		
	}
    else{ 
        document.getElementById('list_name_top').style.display = '';
		document.getElementById('collap_js').className = 'pic_js_up';
		document.getElementById('hide_select').style.display = 'none';
	}

    return;
}
function showHideIdAuto_header_sh() {
    if (document.getElementById('open_js').style.display ==''){
        document.getElementById('open_js').style.display = 'none';
		document.getElementById('collap_sh_js').className = 'pic_sh_down_js';
	}
    else{ 
        document.getElementById('open_js').style.display = '';
		document.getElementById('collap_sh_js').className = 'pic_sh_up_js';
	}
    return;
}

function showHideIdAuto_header_tinh() {
    if (document.getElementById('tinh_orther').style.display ==''){
        document.getElementById('tinh_orther').style.display = 'none';
	}
    else{ 
        document.getElementById('tinh_orther').style.display = '';
	}
    return;
}

function showHideIdAuto_header_us() {
    if (document.getElementById('tinh_orther_us').style.display ==''){
        document.getElementById('tinh_orther_us').style.display = 'none';
	}
    else{ 
        document.getElementById('tinh_orther_us').style.display = '';
	}
    return;
}

function hide_js(){
	document.getElementById('list_name_top').style.display = 'none'
	document.getElementById('collap_js').className = 'pic_js';
	document.getElementById('hide_select').style.display = 'block';
}

function change_tg_vn(obj, action, seller, id){
	closeAllTab();
	var idTab = document.getElementById(obj).id;
	var idShowBox = idTab.replace("tabone","contenttab");
	document.getElementById(idShowBox).style.display='block';
	document.getElementById(idTab).className='active_tab_one';
	getTabInfo(action, seller,id);
}

function getTabInfo(action, seller,id){
	systemForm.setApp("shop");
	systemForm.setAct(action);
	systemForm.setValue('username',seller);
	systemForm.loadAjax(id);
}

function getPage(myapp, myact, myvalue, myid, page){
	systemForm.setApp(myapp);
	systemForm.setAct(myact);
	systemForm.setValue('user_id',myvalue);
	systemForm.setValue(myid,page);
	systemForm.loadAjax(myid+'_ajax');
}

function delGuestBook(gid, owner){
      			systemForm.setApp("shop");
      			systemForm.setAct("deleteGuestBook");
      			systemForm.setValue('gid',gid);
      			systemForm.setValue('owner',owner);
      			systemForm.loadAjax("luubutpage_ajax");
			}


function closeAllTab(){
	for(var i=1; i<5; i++){
		document.getElementById('contenttab'+i).style.display='none'
		document.getElementById('tabone'+i).className='';
	}
}

function changetab(obj){
	if(obj == 'click_pic_top1'){
		clearTimeout(t);
		document.getElementById("show_pic_top1").style.display = "block";
		document.getElementById("click_pic_top1").className = "active_js_top";
	}
	else{
		document.getElementById("show_pic_top1").style.display = "none";
		document.getElementById("click_pic_top1").className = "";
	}
	if(obj == 'click_pic_top2'){
		clearTimeout(t);
		document.getElementById("show_pic_top2").style.display = "block";
		document.getElementById("click_pic_top2").className = "active_js_top";
	}
	else
	{
		document.getElementById("show_pic_top2").style.display = "none";
		document.getElementById("click_pic_top2").className = "";
	}
	if(obj == 'click_pic_top3'){
		clearTimeout(t);
		document.getElementById("show_pic_top3").style.display = "block";
		document.getElementById("click_pic_top3").className = "active_js_top";
	}
	else{
		document.getElementById("show_pic_top3").style.display = "none";
		document.getElementById("click_pic_top3").className = "";
	}
	if(obj == 'click_pic_top4'){
		clearTimeout(t);
		document.getElementById("show_pic_top4").style.display = "block";
		document.getElementById("click_pic_top4").className = "active_js_top";
	}
	else{
		document.getElementById("show_pic_top4").style.display = "none";
		document.getElementById("click_pic_top4").className = "";
	}
	if(obj == 'click_pic_top5'){
		clearTimeout(t);
		document.getElementById("show_pic_top5").style.display = "block";
		document.getElementById("click_pic_top5").className = "active_js_top";
	}
	else{
		document.getElementById("show_pic_top5").style.display = "none";
		document.getElementById("click_pic_top5").className = "";
	}
	if(obj == 'click_pic_top6'){
		clearTimeout(t);
		document.getElementById("show_pic_top6").style.display = "block";
		document.getElementById("click_pic_top6").className = "active_js_top";
	}
	else{
		document.getElementById("show_pic_top6").style.display = "none";
		document.getElementById("click_pic_top6").className = "";
	}
}

var j=0;
var t;	
function auto_change(){		
	if(j<6) j++;
	else j=1;
	var tab= "click_pic_top" + j;	
	changetab(tab);		
	t = setTimeout('auto_change()',3000);
}
window.onload=auto_change;